home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Headers / misckit / MiscUser.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-24  |  2.0 KB  |  68 lines

  1. /****************************************************************************
  2.   CLASS:            MiscUser
  3.   INHERITS FROM:    Object
  4.   CONFORMS TO:        None
  5.   PROGRAMMER:        Todd Thomas, Copyright 1994, 1995.
  6.   DESIGN ADVICE:    Don Yacktman
  7.   DATE BEGAN:        December 17, 1994
  8.   LAST CHANGED:        January 23, 1995
  9.   VERSION:            0.3
  10.   CHANGES:            See end of implementation file.
  11.  
  12.   An instance of MiscUser represents a single user on a system. Once you
  13.   initialize an instance via either uid or username (login name), you can
  14.   then ask the object for information about the user, such as real name,
  15.   shell, home directory, primary group, and a list of groups he/she is
  16.   a member of. You can also ask the class object for a list of all users
  17.   on the system. 
  18.   
  19.   If you are on a system with multiple domains (say local and network)
  20.   there is a possiblility of users belonging to both domains. When
  21.   asking the system for a list of all users, all domains are traversed
  22.   and duplicates entries removed. Oh, and as always, if anyone has any
  23.   ideas on additions/changes to these objects, please let me know.
  24.  
  25.   This object is included in the MiscKit by permission from the author
  26.   and its use is governed by the MiscKit license, found in the file
  27.   "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  28.   for a list of all applicable permissions and restrictions.
  29.    
  30.  *****************************************************************************/
  31.  
  32. #include <objc/Object.h>
  33.  
  34. @class MiscUserGroup;
  35. @class List;
  36.  
  37.  
  38. @interface MiscUser : Object
  39. {
  40.     int  uid;
  41.     int  gid;
  42.     char  *username;
  43.     char  *realname;
  44.     char  *shell;
  45.     char  *homeDirectory;
  46. }
  47.  
  48. + (BOOL)filterSystemUsers;
  49. + setFilterSystemUsers: (BOOL)filter;
  50.  
  51. + (List *)allUsers;
  52. + (MiscUser *)whoAmI;
  53.  
  54. - initWithUserId: (int)userId;
  55. - initWithUsername: (const char *)uname;
  56. - free;
  57.  
  58. - (const char *)username;
  59. - (const char *)realname;
  60. - (int)userId;
  61.  
  62. - (MiscUserGroup *)primaryGroup;
  63. - (List *)groups;
  64. - (const char *)shell;
  65. - (const char *)homeDirectory;
  66.  
  67. @end
  68.